home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: mxsld2.pd.infn.it!LORETI
- From: loreti@mxsld2.pd.infn.it (Maurizio Loreti)
- Subject: Re: Basic Question on SWITCH
- X-Nntp-Posting-Host: mxsld2.pd.infn.it
- Message-ID: <DLwvCz.L78@news.cern.ch>
- Sender: news@news.cern.ch (USENET News System)
- Reply-To: loreti@mxsld2.pd.infn.it
- Organization: I.N.F.N. Padova - CDF/CMS VAXcluster
- References: <4e4cu4$95f@vixen.cso.uiuc.edu>
- Date: Sun, 28 Jan 1996 21:50:57 GMT
-
- In article <4e4cu4$95f@vixen.cso.uiuc.edu>, HOTARD <jhotard> writes:
- >I am just learning how to program in C, and I had a question about switch.
- >I am writing a program that looks at a character and then determines if it is a
- >letter or number. This program must use the switch command , can I place a
- >range on the case command somehow??
- >
- >ie: Switch (var)
- > case 0-9:
- >
- >or case (isdigit):
- >
- >would anything like this work???
-
- No.
- Case labels must evaluate to an integer value at compile time; check
- your textbook. However you may attech multiple labels to the same
- statement.
- --
- Maurizio Loreti http://mvxpd5.pd.infn.it/wwwcdf/mlo.html
- Un. of Padova, Dept. of Physics - Padova, Italy loreti@padova.infn.it
-